package cn.shyouchi.wuguanjia.android.ui.patrol.statistic.page.error;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.base.BaseFragment;
import cn.shyouchi.wuguanjia.android.ui.patrol.statistic.PatrolStatisticEntity;
import cn.shyouchi.wuguanjia.android.ui.patrol.statistic.page.PreviewPatrolInfoActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class PatrolStatisticErrorFragment extends BaseFragment {


    @BindView(R.id.rv_error_content)
    RecyclerView mRvErrorContent;
    PatrolStatisticErrorAdapter mAdapter;

    List<PatrolStatisticEntity.ResultMessageBean.InfoBean.InspectionBean> mEntities = new ArrayList<>();

    public PatrolStatisticErrorFragment() {

    }


    @Override
    public void initInjector() {

    }

    @Override
    public int initContentView() {
        return R.layout.fragment_patrol_statistic_error;
    }

    @Override
    public void getBundle(Bundle bundle) {

    }

    @Override
    public void initUI(View view) {

        ButterKnife.bind(this, view);
        mEntities.clear();
        mEntities.addAll(((PreviewPatrolInfoActivity) getActivity()).getErrorPoint());
        mAdapter = new PatrolStatisticErrorAdapter(mEntities, getActivity());
        mRvErrorContent.setAdapter(mAdapter);
        mRvErrorContent.setLayoutManager(new LinearLayoutManager(getContext()));



        if (mEntities.isEmpty()) {
            showEmpty(false);
        } else {
            showContent(false);
        }
    }

    @Override
    public void initData() {

    }
}
